#ifndef __HELPER_H__
#define __HELPER_H__

#include <QApplication>
#include <QWidget>
#include <QSettings>
#include <stdio.h>
#include <QCloseEvent>
#include <iostream>

#include "brightness.h"
#include "restreminder.h"
#include "helperstyle.h"

#define DEFAULT_WORK_AMOUNT_TIME 10

QT_BEGIN_NAMESPACE
class QMenu;
class QIcon;
class QDialog;
class QGroupBox;
class QSpinBox;
class QSlider;
class QHBoxLayout;
class QVBoxLayout;
class QSystemTrayIcon;
class QPushButton;
class QPixmap;
class QDebug;
class QMainWindow;
class QLabel;
class QAction;
QT_END_NAMESPACE

class KHelper : public QWidget
{
	Q_OBJECT
public:
	KHelper(QWidget *parent = 0);
	~KHelper();
	void initGui();
	int getBrightness();

private slots:
	void trayIconClicked(QSystemTrayIcon::ActivationReason reason);
	void setBrightness(int value);
	void restoreBrightness();
	void enableRRApplyUndoBtn();  // RR is short of rest reminder
	void applyRRSettings();
	void undoRRSettings();
		
private:
	QSettings *m_settings;
  	QSystemTrayIcon *m_systemTrayIcon;
	QMenu *m_systemTrayIconMenu;
	
	QGroupBox *m_brightnessGroupBox;
	QSlider *m_brightnessSlider;
	QSpinBox *m_brightnessSpinBox;
	QPushButton *m_brightnessUndoBtn;
	QLabel *m_brightnessValueLabel;
	QHBoxLayout *m_brightnessBoxLayout;
	
	QGroupBox *m_restReminderGroupBox;
	QHBoxLayout *m_restReminderBoxLayout;
	QSpinBox *m_restReminderSpinBox;
	QPushButton *m_restReminderUndoBtn;
	QPushButton *m_restReminderApplyBtn;
	
	QVBoxLayout *m_mainLayout;

	KBrightness *m_brightness;
	KRestReminder *m_restReminder;
	
	int m_originBrightness;
	int m_originWorkAmountTime;
};

#endif
